#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	int arr[101], brr[10201], hash[10001] = {0};
	int n, i, j, sum = 0, t = 0, max = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
		if (max < arr[i])
			max = arr[i];
	}
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			brr[t++] = arr[i] + arr[j];
		}
	}
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < t; j++)
		{
			if (arr[i] == brr[j])
				hash[arr[i]]++;
		}
	}
	for (i = 1; i <= max; i++)
	{
		if (hash[i])
			sum++;
	}
	printf("%d", sum);
	return 0;
}